<script type="text/javascript">
		Yutil.useLoadingMessage();
		Yutil.en.enhance();
</script>
<%	
		List entNames = EnterpriseService.$.getAllEnterprises();
		
		UIutil $ = UIutil.$;
%>

<fieldset>
		<legend>合同管理</legend>
		<table align="left"  border="0px">
				<tr>
					<th>公司： </th>
					<td>
						<select id='enterpriseId' name='enterpriseId'>
							<option value='-1'>请选择</option>
							<%	
								for(Iterator it = entNames.iterator(); it.hasNext();) 
								{ 
								Enterprise e = (Enterprise) it.next();
							%>
							<option value=<%=e.getEnterpriseId()%>><%=e.getName()%>
							</option>
							<%
								} 
							%>
						</select>
					</td>
				</tr>
				
				<tr>
						<td>
							<input class='button' type="button" onclick="showList(this)" value="查看合同" />
						</td>
						<td>
							<input class='button' type="button" onclick="createContract()" value="创建合同" />
						</td>
				</tr>
				<tr>
						<td>
							<input class='button' type="button" onclick="showRole(this)" value="合同权限" />
						</td>
				</tr>
		</table>
</fieldset>
<script type="text/javascript">
		showList = function(entOption) {
			var value = $('enterpriseId').value;
			var url = 'la_contract_list.jsp';
			var pars =  'enterpriseId=' + value;
			var myAjax = new Ajax.Updater('data',url,{method:'get', parameters: pars,evalScripts: true});
		}
		
		showRole = function(entOption) {
			var value = $('enterpriseId').value;
			var url = 'la_role_create.jsp';
			var pars =  'enterpriseId=' + value;
			var myAjax = new Ajax.Updater('data',url,{method:'get', parameters: pars,evalScripts: true});
		}
		
		createContract = function() {
			Yutil.createDialog('contractCreationDialog', '80%', '80%', '员工创建');
			var url = 'la_contract_create.jsp';
			var myAjax = new Ajax.Updater('contractCreationDialog_content', url, {method:'get', evalScripts: true});
			Yutil.showDialog('contractCreationDialog');
		}
</script> 
<p></p>

<div id="data">
</div>

<%@ page import="com.esms.struts.service.JspWidget" %>
<%@ page import="java.util.*" %>
<%@ page import="com.esms.bean.*" %>
<%@ page import="com.esms.struts.service.*" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>